/**
 * Created by zhuhuijun on 2016/4/20
 * sessionService设置
 * 用户登陆系统数据传递、登陆、退出的操作在此实现
 */
app.factory('$sessionService',function(){
    var _SESSION = {}, LOGINFLAG = false;
    return {
        setUser : function(user) {
            if ( typeof user == 'object') {
                _SESSION.USER = user;
            } else
                throw new Error("User must be Object.");
        },
        getUser : function() {
            return _SESSION.USER;
        },
        isLogin : function() {
            return LOGINFLAG;
        },
        setLoginStauts : function(flag) {
            LOGINFLAG = flag;
        }
    }
});

